//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.spring.schedule_system.dengxiaojiao.util;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.function.Supplier;

public class TransactionAsyncUtil {
    private static Executor asyncExcecutor;

    public TransactionAsyncUtil(Executor asyncExcecutorParam) {
        asyncExcecutor = asyncExcecutorParam;
    }

    public static Executor getAsyncExcecutor() {
        return asyncExcecutor;
    }

    public static void execute(Runnable command) {
        asyncExcecutor.execute(command);
    }

    public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) {
        return CompletableFuture.supplyAsync(supplier, getAsyncExcecutor());
    }
}
